﻿@{
    Layout = "_IndexLayout";
    object id = this.Context.Request.Query["ID"];
    var home_home_sm = PageViewModel.ControlID(this, "home_home_sm", postfix: (id!=null?id.ToString():DateTime.Now.Ticks.ToString()));
    var load_home_home_sm = PageViewModel.PageFunctionName(this, "load_home_home_sm", postfix: (id != null ? id.ToString() : DateTime.Now.Ticks.ToString()));
    var user = ViewBag.User as Admin.CYT369.Com.DAL.Domains.SysUser;
}

@section LeftPanel{
    @if (user != null)
    {
        <div style="height: 90px;margin-top: 20px;padding-left: 20px;border-bottom: solid 1px #ddd;">
            @if (!string.IsNullOrEmpty(user.Avatar))
            {
                <img style="float: left;width: 60px;height: 60px;border-radius: 30px;" src="@user.Avatar" />
            }
            else if (!string.IsNullOrEmpty(user.HeaderUrl))
            {
                <img style="float: left;width: 60px;height: 60px;border-radius: 30px;" src="@user.HeaderUrl" />
            }
            else
            {
                var name = user.FullName;
                if (!string.IsNullOrEmpty(name))
                {
                    name = user.FullName.Substring(0, 1);
                }
                <div style="float: left;width: 60px;height: 60px;border-radius: 30px;">@name</div>
            }

            <div style="float:left;font-size:12px;line-height:20px;margin-left:10px;">
                <div>@user.FullName</div>
                <div>藕之然科技</div>
                <div>@user.UserName</div>
            </div>
        </div>
    }
    <div id="@home_home_sm" style='width:100%'></div>
    <script type="text/javascript">
        function @load_home_home_sm () {
            $.ajax({
                url: "~/Home/GetSubMenus/" + @id,
                success: function (menus) {
                    var p = $("#@home_home_sm");
                    p.html("");
                    var sm = $(MySideMenu(menus));
                    sm.appendTo(p);
                    BindMySideMenu(sm);
                }
            });
        }

        $(document).ready(function () {
            @load_home_home_sm ();
        });
    </script>
}

@section ContentPanel{
    <span>this is home content panel</span>
}